import request from '@/utils/request'

// 车辆基本信息
export function getCarBasicInfo(data) {
    return request({
        url: '/service-eam/gf-vehicle-info/query-list',
        method: "post",
        params: data
    })
}
// 驾驶员信息
export function getDriverInfo(data) {
    return request({
        url:"/service-eam/gf-driver/query-list",
        method: "post",
        params: data
    })  
}

// 获取图片
export function getImage(id) {
    return request({
        url: '/service-storage/sys-file/image',
        method: 'get',      
        responseType: 'blob',
        params: {id}
    })
}

// 查询不动产
export function getRealEstate(data) {
    return request({
        url: "/service-eam/gf-real-estate/query-list",
        method: "post",
        params: data
    })
}

// 不动产出租 查询不动产地址
export function getAddress(id) {
    return request({
        url: "/getAddressByUnitNumber",
        method: "get",
        params: {
            unitNumber: id
        }
    })
}

/** 
 * 不动产
*/

// 查询不动产
export function getQueryList(data) {
    return request({
        url: '/service-eam/gf-real-estate/query-paged-list',
        method: 'post',
        params: data
    })
}

//新增不动产
export function addReal_estate(data) {
    return request({
        url: '/service-eam/gf-real-estate/insert',
        method: 'post',
        data
    })
}

//修改不动产
export function editReal_estate(data) {
    return request({
        url: '/service-eam/gf-real-estate/update',
        method: 'post',
        data
    })
}

//删除不动产
export function delReal_estate(id) {
    return request({
        url: '/service-eam/gf-real-estate/delete',
        method: 'post',
        params: {
            id
        }
    })
}

/**
 * 不动产出租
 */

//新增
export function addReal_estate_rental(data) {
    return request({
        url: '/service-eam/gf-real-estate-rental/insert',
        method: "post",
        data
    })
}

//修改
export function editReal_estate_rental(data) {
    return request({
        url: '/service-eam/gf-real-estate-rental/update',
        method: 'post',
        data
    })
}

//删除
export function delReal_estate_rental(id) {
    return request({
        url: '/service-eam/gf-real-estate-rental/delete',
        method: "post",
        params:{
            id
        }
    })
}

/**
 * 驾驶员
 */

//新增
export function addDriver(data) {
    return request({
        url: "/service-eam/gf-driver/insert",
        method: 'post',
        data
    })
}

// 修改
export function editDriver(data) {
    return request({
        url: "/service-eam/gf-driver/update",
        method: "post",
        data
    })
}

// 删除
export function delDriver(id) {
    return request({
        url: '/service-eam/gf-driver/delete',
        method: "post",
        params: {id}
    })
}

/** 车辆档案 */

// 新增
export function addVehicleInfo(data) {
    return request({
        url: '/service-eam/gf-vehicle-info/insert',
        method: 'post',
        data
    })
}

// 修改
export function editVehicleInfo(data) {
    return request({
        url: '/service-eam/gf-vehicle-info/update',
        method: 'post',
        data
    })
}
// 删除
export function delVehicleInfo(id) {
    return request({
        url: '/service-eam/gf-vehicle-info/delete',
        method: 'post',
        params: {
            id
        }
    })
}

/** 里程上报 */

// 新增
export function addMileageReporting(data) {
    return request({
        url: '/service-eam/gf-mileage-reporting/insert',
        method: 'post',
        data
    })
}

// 修改
export function editMileageReporting(data) {
    return request({
        url: '/service-eam/gf-mileage-reporting/update',
        method: 'post',
        data
    })
}

// 删除
export function delMileageReporting(id) {
    return request({
        url: '/service-eam/gf-mileage-reporting/delete',
        method: 'post',
        params: { id }
    })
}
